//
//  main.m
//  syl
//
//  Created by mac on 16-4-18.
//  Copyright (c) 2016年 4-18. All rights reserved.
//

#import <Foundation/Foundation.h>
@interface Rectangle:NSObject{
    double _lens;
    double _wide;
}
-(void)setLens:(double)lens;
-(void)setWide:(double)wide;
-(void)setLens:(double)lens andWide:(double)wide;

-(double)lens;
-(double)wide;

-(double)getPremeter;
-(double)getArea;
@end

@implementation Rectangle
-(void)setLens:(double)lens{
    _lens=lens;
}
-(void)setWide:(double)wide{
    _wide=wide;
}
-(void)setLens:(double)lens andWide:(double)wide{
    _lens=lens;
    _wide=wide;
}
-(double)lens{
    return _lens;
}
-(double)wide{
    return _wide;
}

-(double)getPremeter{
    return 2*_lens+2*_wide;
}
-(double)getArea{
    return _lens*_wide;
}

@end
int main(int argc, const char * argv[])
{
    
    
    @autoreleasepool {
        
        Rectangle *r1=[[Rectangle alloc]init];
        [r1 setLens:5.6 andWide:4.5];
        [r1 setLens:4];
        NSLog(@"%g*%g,长方形的周长:%g,面积%g",
              [r1 lens],[r1 wide],[r1 getPremeter],[r1 getArea]);
        
    }
    return 0;
}
